package com.pactera.madp.cp.controller.oms.product;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pactera.madp.common.core.util.R;
import com.pactera.madp.cp.api.dto.product.ProductContactQueryDto;
import com.pactera.madp.cp.service.ProdContactService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: yushen.qi
 * @Date: 2021/12/16/10:37
 * @Description:
 */
@RestController
@AllArgsConstructor
@RequestMapping("/product-contact")
@Api(value = "product", tags = "产品分析管理")
public class ProductContactController {

    @Resource
    private ProdContactService prodContactService;

    /**
     * 分页查询产品
     *
     * @param page 分页对象
     * @param req 查询产品传输对象
     * @return
     */
    @GetMapping("/page")
    @ApiOperation(value = "分页查询产品")
    public R getProductPage(Page page, ProductContactQueryDto req){
        return R.ok(prodContactService.getPage(page,req));
    }

    /**
     * 推荐产品查询
     *
     * @return
     */
    @GetMapping("/love")
    @ApiOperation(value = "推荐产品查询")
    public R getProductPage(){
        return R.ok(prodContactService.getProduct());
    }

}
